﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:"Index".Localize() %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="title">
        <%:"Questions".Localize() %></h3>
    <div class="command clearfix">
    </div>
    <div class="table-container">
        <table>
            <thead>
                <tr>
                    <th>
                        <%:"Question".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Customer".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Product".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Date".Localize() %>
                    </th>
                    <th colspan="2" class="action">
                        <%:"Action".Localize() %>
                    </th>
                </tr>
            </thead>
            <tbody id="question-container">
            </tbody>
        </table>
        <table id="question-row" class="hide">
            <tbody>
                <tr class="template">
                    <td>
                        What's going on?
                    </td>
                    <td>
                        <a href="#">Guest</a>
                    </td>
                    <td>
                        <a href="#">Demo product</a>
                    </td>
                    <td>
                        2011-01-21 15:30
                    </td>
                    <td class  ="action">
                        <a href="#view-dialog" class="o-icon view dialog-link display-view" title="View">
                            <%:"View".Localize() %></a>
                        <a href="#answer-dialog" class="o-icon answer dialog-link edit-view" title="Answer">
                            <%:"Answer".Localize() %></a>
                    </td>
                    <td class="action">
                        <form action='<%= ViewData["delete_action"] %>' method="post" class="delete-form">
                        <a href="#" class="o-icon delete delete-link" message='<%= "Are you sure you want to delete this question?".Localize() %>'
                            title="Delete">
                            <%:"Delete".Localize() %></a>
                        <input type="hidden" name="Id" />
                        </form>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="hide">
        <div class="dialog" id="answer-dialog" title="Answer" style="height: 200px; width: 600px">
            <div class="common-form">
                <div id="answer_messagebox">
                    <div id="message-box-error" class="hide message-box error message-box-error">
                        <p>
                        </p>
                    </div>
                    <div id="message-box-info" class="hide message-box info message-box-info">
                        <p>
                        </p>
                    </div>
                </div>
                <form action='<%= ViewData["answer_action"] %>' method="post" id="answer-form">
                <fieldset>
                    <table>
                        <tbody>
                            <tr>
                                <td>
                                    <textarea name="Answer" style="height: 76px; width: 568px;"></textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </fieldset>
                <div class="buttons">
                    <button type="submit">
                        <%:"Save".Localize() %></button>
                </div>
                <input type="hidden" name="QuestionId" id="QuestionId" />
                </form>
            </div>
        </div>
        <div class="dialog" id="view-dialog" title="Answer view" style="height: 200px; width: 600px">
            <div class="common-form">
                <fieldset>
                    <table>
                        <tbody>
                            <tr>
                                <th class="by">
                                    Date
                                </th>
                                <td class="date">
                                    2011-01-21 15:40
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <textarea style="height: 85px; width: 568px;" disabled="disabled" class="body"></textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </fieldset>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        var questions = <%= ViewData["questions"] %>;

    </script>
    <%using (var loader = ClientLoader.RegisterInstance())
      {
          loader.Require("productquestion.index.js");
      } %>
</asp:Content>
